From: Richard M. Stallman Date: Thu, 15 Sep 1994 02:35:45 +0000 (+0000) Subject: (command-line): If we can't load x-win.el, terminate. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~90315 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=1ed14cfd6db155ac2a49e129a9245928c1654d48;p=emacs.git (command-line): If we can't load x-win.el, terminate. --- diff --git a/lisp/startup.el b/lisp/startup.el index a31aa73f7d4..5b5594e4a61 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -246,13 +246,28 @@ specified by the LC_ALL, LC_CTYPE and LANG environment variables.") ;;! (setq split-window-keep-point (> baud-rate 2400)) ;; Read window system's init file if using a window system. - (if (and window-system (not noninteractive)) - (load (concat term-file-prefix - (symbol-name window-system) - "-win") - ;; Every window system should have a startup file; - ;; barf if we can't find it. - nil t)) + (condition-case error + (if (and window-system (not noninteractive)) + (load (concat term-file-prefix + (symbol-name window-system) + "-win") + ;; Every window system should have a startup file; + ;; barf if we can't find it. + nil t)) + ;; If we can't read it, print the error message and exit. + (error + (if (eq (car error) 'error) + (message "%s" (apply 'concat (cdr error))) + (if (memq 'file-error (get (car error) 'error-conditions)) + (message "%s: %s" + (nth 1 error) + (mapconcat '(lambda (obj) (prin1-to-string obj t)) + (cdr (cdr error)) ", ")) + (message "%s: %s" + (get (car error) 'error-message) + (mapconcat '(lambda (obj) (prin1-to-string obj t)) + (cdr error) ", ")))) + (kill-emacs))) (let ((done nil) (args (cdr command-line-args)))